package main.classes;
import java.io.IOException;
import java.net.ServerSocket;
import java.net.Socket;

public class PortListener {
	
	private static ServerSocket serverSocket;
	
	public static void main(String []args) {
		try {
			Server server = Server.getServer();
			serverSocket = Server.getServerSocket();
			while (Server.isNotStopped() && (serverSocket != null)) {
				Socket socket = serverSocket.accept();
				server.parseInputSocket(socket);
			}
		} catch (IOException e) {
			System.err.println(e);
		}
	}
	
	public static void setSocketGetter(ServerSocket server) {
		serverSocket = server;
	}

	public static ServerSocket getSocketGetter() {
		return serverSocket;
	}
}
